<template>
    <baidu-map :center="center" :zoom="15" :scroll-wheel-zoom="true" @ready="handler" class="bm-view">
        <bm-marker :position="{lng: 116.404, lat: 39.915}" :dragging="true" animation="BMAP_ANIMATION_BOUNCE">
            <bm-label content="我爱北京天安门" :labelStyle="{color: 'red', fontSize : '24px'}"
                      :offset="{width: -35, height: 30}"/>
        </bm-marker>
    </baidu-map>
</template>
<script>
    export default {
        data() {
            return {
                center: {lng: 0, lat: 0},
            }
        },
        methods: {
            handler({BMap, map}) {
                this.center.lng = 116.404;
                this.center.lat = 39.915;
            }
        }
    }
</script>
<style>
    .bm-view {
        width: 100%;
        height: 100%;
    }
</style>
